import httpRequest from "@/request";
import { WdLayout, WdList, WdPage } from "@/types/request";

export default {
  //#region 用户管理
  user_list: (params: WdPage) => {
    return httpRequest.get<WdList<any>>({
      url: `/user`,
      params,
    });
  },
  user_info: (id: number) => {
    return httpRequest.get<WdLayout<any>>({
      url: `/user/${id}`,
    });
  },
  user_create: (params: any) => {
    return httpRequest.post<WdLayout<any>>({
      url: `/user/create`,
      data: params,
    });
  },
  user_delete: (id: number) => {
    return httpRequest.delete<WdLayout<any>>({
      url: `/user/delete/${id}`,
    });
  },
  //#endregion
  //#region 用户权限
  user_right_list: (params: WdPage) => {
    return httpRequest.get<WdList<any>>({
      url: `/user/right/list`,
      params,
    });
  },
  user_right_info: (id: number) => {
    return httpRequest.get<WdLayout<any>>({
      url: `/user/right/${id}`,
    });
  },
  user_right_create: (params: any) => {
    return httpRequest.post<WdLayout<any>>({
      url: `/user/right/create`,
      data: params,
    });
  },
  user_right_delete: (id: number) => {
    return httpRequest.delete<WdLayout<any>>({
      url: `/user/right/delete/${id}`,
    });
  },
  //#endregion
};
